package org.vectrics.skill;


import java.io.Serializable;
import java.util.Comparator;

/**
 * @author mmoore
 */
public class SkillChildComparator implements  Comparator, Serializable {

	
	public int compare(Object obj1, Object obj2) {
		int result = 0;
		Skill skill1 = (Skill)obj1;
		Skill skill2 = (Skill)obj2;
		result = 0;
		if (skill1.getChildIndex() < skill2.getChildIndex())
			result = -1;
		else if (skill1.getChildIndex() > skill2.getChildIndex())
			result = 1;
		else {
			result = skill1.getCode().compareTo(skill2.getCode());
		}
		
		return(result);
	}
	
}
